package com.jay.io.clazz;

import java.io.CharArrayWriter;
import java.io.FileNotFoundException;
import java.io.PrintWriter;

public class PrintWriterCls {
	public static void main(String[] args) throws FileNotFoundException {
		PrintWriter ps = new PrintWriter("out.txt");
		ps.append('a');
		ps.print(5);
		ps.print("wocao");
		ps.println("wocao");
		ps.flush();

		CharArrayWriter cw = new CharArrayWriter();
		ps = new PrintWriter(cw);
		ps.append('a');
		ps.print(5);
		ps.print("wocao");
		ps.println("wocao");
		System.out.println(cw);
		ps.close();
	}
}
